package online.longzipeng.back.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import online.longzipeng.back.pojo.entity.Bill;
import online.longzipeng.back.pojo.param.BillQueryParam;
import online.longzipeng.back.pojo.vo.BillVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * @author lzp
 */
@Mapper
public interface BillMapper extends BaseMapper<Bill> {

    /**
     * 按条件分页查询账单数据
     */
    Page<BillVo> page(Page<BillVo> page, @Param("param") BillQueryParam param);

    /**
     * 查看账单详情
     *
     * @param id
     */
    BillVo detail(@Param("id") Long id);

    /**
     * 查询条件下的收支
     */
    BigDecimal getIncomeOrExpenditure(@Param("param") BillQueryParam billQueryParam);
}
